<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:51:"themes/admin_simpleboot3/admin/user/user_index.html";i:1599722776;s:43:"themes/admin_simpleboot3/public/header.html";i:1584585426;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <title><?php echo Config('web_name'); ?></title>

    <link href="__TMPL__/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script src="__TMPL__/public/assets/js/echarts.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
<link rel="stylesheet" href="__STATIC__/js/element/css/element.css">
<style>
    [v-cloak] {
        display: none !important;
    }
    .tab-height {
        height: 60px;
        line-height: 60px;
        text-align: center;
    }

    .th-class {
        background-color: rgb(249, 249, 249);
    }

    .td-class .el-input__inner {
        border: 0 none;
    }

    .border-top {
        border-top: 1px solid rgb(229, 229, 229);
        border-left: 1px solid rgb(229, 229, 229);
    }

    .border-only-top {
        border-top: 1px solid rgb(229, 229, 229);
    }

    .border-right {
        border-right: 1px solid rgb(229, 229, 229);
    }
    .border-bottom {
        border-bottom: 1px solid rgb(229, 229, 229);
    }
    .wrap_area{
        display: flex;
        justify-content: space-around;
    }
    .wrap_title{
        display: flex;
        justify-content: space-between;
    }
    .sj_title{
        font-size: 20px;
        font-weight: bold;
        padding: 10px;
    }

</style>
</head>
<body>

<div class="wrap js-check-wrap" id="app" v-cloak>
    <ul class="nav nav-tabs" >
        <li class="active"><a href="#">个人首页</a></li>
    </ul>
    <div style="padding: 20px;width: 100%;">
        <div style="padding: 20px;font-size: 16px" class="wrap_title">
            <strong>基本信息</strong>
            <div v-if="showBtn==1">
                <el-button size="mini" type="primary" style="margin-left: 20px;" @click="showAreaDialog">对下属评分</el-button>
            </div>
        </div>
        <el-row class="border-top border-right border-bottom">
            <el-col :span="18">
                <el-row class="border-right">
                    <el-col :span="3" class="tab-height th-class">姓名</el-col>
                    <el-col :span="5" class="tab-height">
                        {{user.user_login}}
                    </el-col>
                    <el-col :span="3" class="tab-height th-class">工号</el-col>
                    <el-col :span="5" class="tab-height">
                        {{user.employee_id}}
                    </el-col>
                </el-row>

                <el-row class="border-only-top border-right">
                    <el-col :span="3" class="tab-height th-class">手机号码</el-col>
                    <el-col :span="5" class="tab-height">
                        {{user.mobile}}
                    </el-col>
                    <el-col :span="3" class="tab-height th-class">部门</el-col>
                    <el-col :span="5" class="tab-height">
                        {{user.department}}
                    </el-col>
                </el-row>

            </el-col>
            <el-col :span="6" style="text-align: center;">
                <el-image style="width: 170px" :src="avatar" fit="scale-down"></el-image>
            </el-col>
        </el-row>

        <div style="padding: 20px;font-size: 16px"><strong>当月评分</strong></div>

        <el-table
                :data="tableData"
                border
                style="width: 100%;">
            <el-table-column
                    prop="title"
                    label="名称"
                    width="220">
            </el-table-column>
            <el-table-column
                    prop="add_time"
                    label="提交时间"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="status_str"
                    label="状态">
            </el-table-column>
            <el-table-column
                    prop="my_grade"
                    label="自我评分">
            </el-table-column>
            <el-table-column
                    prop="my_grade_time"
                    label="自我评分时间">
            </el-table-column>
            <el-table-column
                    prop="leader_grade"
                    label="领导评分">
            </el-table-column>
            <el-table-column
                    prop="leader_grade_time"
                    label="领导评分时间">
            </el-table-column>
            <el-table-column
                    prop="leader_grade_time"
                    label="累计评分">
            </el-table-column>
            <el-table-column prop="type" label="得分详请">
                <template scope="scope" >
                    <el-button type="primary" size="small" @click="checkDetail(scope.row.type,scope.row.month)">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>

        <div style="padding: 20px;font-size: 16px"><strong>历史评分</strong></div>

        <el-table
                :data="history_tableData"
                border
                style="width: 100%;">
            <el-table-column
                    prop="title"
                    label="名称"
                    width="220">
            </el-table-column>
            <el-table-column
                    prop="add_time"
                    label="提交时间"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="status_str"
                    label="状态">
            </el-table-column>
            <el-table-column
                    prop="my_grade"
                    label="自我评分">
            </el-table-column>
            <el-table-column
                    prop="my_grade_time"
                    label="自我评分时间">
            </el-table-column>
            <el-table-column
                    prop="leader_grade"
                    label="领导评分">
            </el-table-column>
            <el-table-column
                    prop="leader_grade_time"
                    label="领导评分时间">
            </el-table-column>
            <el-table-column
                    prop="leader_grade_time"
                    label="累计评分">
            </el-table-column>
            <el-table-column prop="type" label="得分详请">
                <template scope="scope" >
                    <el-button type="primary" size="small" @click="checkDetail(scope.row.type,scope.row.month)">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>


        <el-dialog title="优秀处员工列表" :visible.sync="dialogTableVisible">
            <el-table
                    :data="officeTableData"
                    v-loading="loading"
                    stripe
                    style="width: 100%">
                <el-table-column
                        prop="employee_id"
                        label="员工编号"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="user_login"
                        label="姓名"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="mobile"
                        label="手机号">
                </el-table-column>
                <el-table-column prop="type" label="操作">
                    <template scope="scope" >
                        <el-button type="primary" size="small" @click="checkScore(scope.row.id)">进入</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>


    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="__STATIC__/js/element/js/element.js"></script>


<script type="text/javascript">

    let app = new Vue({
        el: '#app',
        data: {
            areaList:[],
            tableData: [],
            dialogTableVisible: false,
            history_tableData: [],
            user:'',
            avatar:'',
            showBtn:0,
            officeTableData: [],
            options: [],
            loading: true,
        },
        created: function () {
            //获取当前评分
            let that = this;
            $.ajax({
                url: GV.ROOT + "admin/user/getCurrentGrade",
                data: {

                },
                dataType: "json",
                type: "post",
                success: function (res) {
                    if (res.code === 200) {
                        that.tableData = res.data.list
                        that.history_tableData = res.data.history_list
                        that.user = res.data.user
                        that.avatar = res.data.user.avatar
                        that.showBtn = res.data.roleId

                        let departmentId = res.data.departmentId
                        that.getExcellentList(departmentId);


                    }
                }
            });
        },
        methods: {
            //获取该部门下的人员
            getExcellentList(departmentId){
                let that = this;
                $.ajax({
                    url: GV.ROOT + "admin/user/getOfficeList",
                    data: {
                        office_id:departmentId
                    },
                    dataType: "json",
                    type: "post",
                    success: function (res) {
                        if (res.code === 200) {
                            that.options = res.data.department_list
                            that.officeTableData = res.data.user_list
                        }
                        that.loading=false
                    }
                });
            },
            showAreaDialog(){
                this.dialogTableVisible = true;
            },
            checkScore(id){
                window.location.href= GV.ROOT + "admin/user/department_charge_audit?uid="+id
            },
            checkDetail(type,month){
                if (type === '1'){
                    window.location.href= GV.ROOT + "admin/user/department_audit?month="+month
                }else{
                    window.location.href= GV.ROOT + "admin/user/personal_audit?month="+month
                }
            },
            //进入各区审计局
            getDepartment(id){
                let that = this;
                $.ajax({
                    url: GV.ROOT + "admin/user/checkReport",
                    data: {
                        departmentId:id
                    },
                    dataType: "json",
                    type: "post",
                    success: function (res) {
                        console.log(res);
                        if (res.code === 200) {
                            window.location.href= GV.ROOT + "admin/user/personal_admin_audit?id="+id
                        }else{
                            that.$message({
                                message: res.message,
                                type: 'warning'
                            });
                        }
                    }
                });

            }
        }
    })
</script>


</body>
</html>